#include "software_update_subs.h"
#include "ui_software_update_subs.h"
#include <QSettings>
software_update_subs::software_update_subs(QWidget *parent, int index) :
    QWidget(parent),
    ui(new Ui::software_update_subs)
{
    ui->setupUi(this);

    u_version_blck = new version_blck;
    u_version_blck->setWindowTitle("u_version_blck");
    ui->ui_pages->addTab(u_version_blck,u_version_blck->windowTitle());
    // --------------------------------------------
    // 增加帮助文档
    u_help_document_mdle = new help_document_mdle;
    u_help_document_mdle->setWindowTitle("u_help_document_mdle");
    ui->ui_pages->addTab(u_help_document_mdle,u_help_document_mdle->windowTitle());

    // --------------------------------------------
    // 设置默认的页面
    ui->ui_pages->setCurrentIndex(index);
}

software_update_subs::~software_update_subs()
{
    delete ui;
}

void software_update_subs::get_bug_file()
{
    u_version_blck->get_bug_file();

}

void software_update_subs::set_app_theme(QString theme)
{
    QString setting_ini = QApplication::applicationDirPath() + "/user_data/setting.ini";
    QSettings* settings = new QSettings(setting_ini,QSettings::IniFormat);
    settings->setValue("main_theme",theme);
    delete settings;
}
